package com.fruit.service.user;

import java.util.List;
import java.util.Map;

import com.fruit.pojo.address.Address;
import com.fruit.pojo.user.MyFruitTree;
import com.fruit.pojo.user.UserInfo;
import com.fruit.pojo.user.UserLogin;

public interface UserManager {
	
	/**通过Token获取UserLogin
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public UserLogin getUserLoginByToken(Map<String, Object> params);
	
	public UserLogin getUserLoginByPhone(UserLogin ul);
	
	public int updateUserLoginToken(UserLogin ul);
	
	public UserInfo getUserInfoByLoginId(int loginId);

	/**获取用户
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public UserInfo getUser(int userId);

	/**收货信息列表
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public List<Address> getAddressList(int userId);
	
	/**修改收货信息状态
	 * @param Address
	 * @return
	 * @throws Exception
	 */
	public void updateAddStatus(Address addre);

	/**添加收货信息
	 * @param Address
	 * @return
	 * @throws Exception
	 */
	public void saveAddress(Address address);

	/**修改收货信息
	 * @param Address
	 * @return
	 * @throws Exception
	 */
	public void updateAddress(Address address);

	/**收货信息
	 * @param Address
	 * @return
	 * @throws Exception
	 */
	public Address getAddressById(int addressId);

	/**删除收货信息
	 * @param Address
	 * @return
	 * @throws Exception
	 */
	public void deleteAddress(int addressId);

	/**修改用户头像
	 * @param UserInfo
	 * @return
	 * @throws Exception
	 */
	public void updateUserHeadImage(UserInfo user);

	/**修改用户头像
	 * @param UserInfo
	 * @return
	 * @throws Exception
	 */
	public void updateUserMess(UserInfo user);

	/**我的果树
	 * @param UserInfo
	 * @return
	 * @throws Exception
	 */
	public List<MyFruitTree> getMyFruitTreeList(Map<String, Object> parame);

	public Map<String, Object> updateCodeToLogin(UserLogin ul,String type);

	/**用户注册
	 * @param UserInfo
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> saveUser(UserLogin ul,String type);

	/**修改登录密码
	 * @param UserLogin
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> updateUserPwd(UserLogin ul, String type);

	public Map<String, Object> updatePwd(String userId, String oldPwd, String newPwd);

	public Map<String, Object> updatePwdToLogin(UserLogin ul); 
	public Map<String, Object> getUserParent(Integer userId);
	
	public UserInfo getParentOne(Integer userId);
	
	public Map<String, Object> getDownUserNum(Integer userId);

	/**邀请注册
	 * @param UserInfo
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> saveInviteUser(UserLogin ul, String type);
	
	/**修改用户认购状态
	 * @param UserInfo
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> updateUserBuyState(Integer userId);
}
